# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rustpad
pkgver=v1.8.1.r1.g11ce343
pkgrel=1
pkgdesc='Multi-threaded Padding Oracle attacks against any service.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-crypto' 'blackarch-cracker')
url='https://github.com/Kibouo/rustpad'
license=('GPL3')
makedepends=('git' 'cargo')
source=("git+https://github.com/Kibouo/$pkgname.git")
options=(!strip)
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  cargo build --release --locked
}

package() {
  cd $pkgname

  install -Dm 755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
}

